﻿<vt:WpfWindow x:Class="TestApplication.Window1"
        xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
        xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
        xmlns:vt="clr-namespace:VisualTools.Controls;assembly=VisualTools.Controls" x:Name="mainwin"
        Icon="/TestApplication;component/laptop.png" Theme="Blue" Title="WPF Window: Sample Application" TitleText="WPF Window: Sample Application"
        Height="400" Width="500">
    <vt:WpfWindow.Resources>
        <Style x:Key="LooklessButton" TargetType="Button">
            <Setter Property="Template">
                <Setter.Value>
                    <ControlTemplate TargetType="Button">
                        <Border Padding="5,5,5,5" BorderBrush="DimGray" Margin="0,2,2,2" BorderThickness="1" 
                                CornerRadius="2" x:Name="buttonBorder">
                            <Border.Background>
                                <LinearGradientBrush EndPoint="0.5,1" StartPoint="0.5,0">
                                    <GradientStop Color="#FFE7E7E7" Offset="0.495"/>
                                    <GradientStop Color="#FFC7C7B7" Offset="1"/>
                                </LinearGradientBrush>
                            </Border.Background>
                            <ContentPresenter />
                        </Border>
                        <ControlTemplate.Triggers>
                            <Trigger Property="Border.IsMouseOver" Value="True">
                                <Setter TargetName="buttonBorder" Property="Border.Background">
                                    <Setter.Value>
                                        <LinearGradientBrush EndPoint="0.5,1" StartPoint="0.5,0">
                                            <GradientStop Color="#FFFFFCC0" Offset="0.495"/>
                                            <GradientStop Color="#FFFFE22C" Offset="1.0"/>
                                        </LinearGradientBrush>
                                    </Setter.Value>
                                </Setter>
                                <Setter TargetName="buttonBorder" Property="Border.BorderBrush" Value="{StaticResource HoverYellowBorder}" />
                            </Trigger>
                            <Trigger Property="Button.IsPressed" Value="True">
                                <Setter TargetName="buttonBorder" Property="Border.Background">
                                    <Setter.Value>
                                        <LinearGradientBrush EndPoint="0.5,1" StartPoint="0.5,0">
                                            <GradientStop Color="#FFFFDD64" Offset="0.429"/>
                                            <GradientStop Color="#FFFFC52C" Offset="0.139"/>
                                            <GradientStop Color="#FFFFDD64" Offset="0.139"/>
                                            <GradientStop Color="#FFC3A84A" Offset="0.036"/>
                                            <GradientStop Color="#FFFFC52C" Offset="1"/>
                                            <GradientStop Color="#FFFFD5BC" Offset="1"/>
                                            <GradientStop Color="#FFFFE9B0" Offset="1"/>
                                        </LinearGradientBrush>
                                    </Setter.Value>

                                </Setter>
                                <Setter TargetName="buttonBorder" Property="Border.BorderBrush" Value="{StaticResource PressOrangeBorder}" />
                            </Trigger>
                        </ControlTemplate.Triggers>
                    </ControlTemplate>
                </Setter.Value>
            </Setter>
        </Style>
        
        <Menu x:Key="MenuResource" Background="Transparent">
            <MenuItem Header="File">
                <MenuItem Header="New"></MenuItem>
                <MenuItem Header="Open"></MenuItem>
                <MenuItem Header="Save"></MenuItem>
                <MenuItem InputGestureText="Alt+F4" Header="Exit"></MenuItem>
            </MenuItem>
            <MenuItem Header="Edit">
                <MenuItem Header="Undo"></MenuItem>
                <MenuItem Header="Redo"></MenuItem>
                <Separator />
                <MenuItem Header="Cut"></MenuItem>
                <MenuItem Header="Copy"></MenuItem>
                <MenuItem Header="Paste"></MenuItem>
                <MenuItem Header="Delete"></MenuItem>
            </MenuItem>
        </Menu>
        
        <Button Height="40" Style="{StaticResource LooklessButton}" x:Key="ButtonResource">
            
        </Button>
        
    </vt:WpfWindow.Resources>
    <Grid>
        <Grid.RowDefinitions>
            <RowDefinition Height="Auto" />
            <RowDefinition />
        </Grid.RowDefinitions>
        <Border Grid.Row="0" Margin="15" VerticalAlignment="Top" BorderBrush="LightGray" BorderThickness="0,0,0,1">
            <Border Padding="0,0,0,10" BorderBrush="DimGray" BorderThickness="0,0,0,1">
                <TextBlock>WPF Window</TextBlock>
            </Border>
        </Border>
        
        <Border BorderThickness="1" BorderBrush="DimGray" CornerRadius="6" Margin="15,0,15,15" Grid.Row="1">
            <Border.Background>
                <LinearGradientBrush Opacity="0.44" EndPoint="0.5,1" StartPoint="0.5,0">
                    <GradientStop Color="LightGray" Offset="0.0"/>
                    <GradientStop Color="Gray" Offset="1"/>
                </LinearGradientBrush>
            </Border.Background>
            <Grid Margin="10">
                <DockPanel LastChildFill="False">
                    <Button Width="100" VerticalAlignment="Top" HorizontalAlignment="Left" 
                        Click="OpenNewWindow_Click"
                        Style="{StaticResource LooklessButton}">
                        <TextBlock FontSize="12" VerticalAlignment="Center" TextWrapping="Wrap" TextAlignment="Center" Text="Create New Window" />
                    </Button>
                    <Button Width="100" VerticalAlignment="Top" HorizontalAlignment="Left" 
                        Click="OpenNewModalWindow_Click"
                        Style="{StaticResource LooklessButton}">
                        <TextBlock FontSize="12" VerticalAlignment="Center" TextWrapping="Wrap" TextAlignment="Center" Text="Create New Modal Window" />
                    </Button>
                    <Button Width="100" VerticalAlignment="Top" HorizontalAlignment="Left" 
                        Click="CloseThisWindow_Click"
                        Style="{StaticResource LooklessButton}">
                        <TextBlock FontSize="12" VerticalAlignment="Center" TextWrapping="Wrap" TextAlignment="Center" Text="Close This Window" />
                    </Button>
                </DockPanel>
                <GroupBox VerticalAlignment="Top" Header="Change Title Content" Margin="0,55,0,0">
                    <Grid>
                        <DockPanel Margin="10,10,0,0">
                            <ToggleButton Click="ChangeTitleContainerToNormal_Click" x:Name="toggleNormal" IsChecked="True" Width="75" VerticalAlignment="Top" HorizontalAlignment="Left">
                                Normal
                            </ToggleButton>
                            <ToggleButton Click="ChangeTitleContainerToButton_Click" x:Name="toggleButton" Width="75" VerticalAlignment="Top" HorizontalAlignment="Left">
                                Button
                            </ToggleButton>
                            <ToggleButton Click="ChangeTitleContainerToMenu_Click" x:Name="toggleMenu" Width="75" VerticalAlignment="Top" HorizontalAlignment="Left">
                                Menu
                            </ToggleButton>
                        </DockPanel>
                        <TextBlock HorizontalAlignment="Left" VerticalAlignment="Top" Margin="10,40,0,0" Text="Title Text" />
                        <TextBox Text="WPF Window: Sample Application" x:Name="titleText" HorizontalAlignment="Left" VerticalAlignment="Top" Width="200" Height="23" Margin="75,40,0,0" />
                    </Grid>
                </GroupBox>
                <GroupBox VerticalAlignment="Top" Header="Theme" Margin="0,145,0,0">
                    <Grid>
                        <DockPanel Margin="10,10,0,0">
                            <RadioButton x:Name="rbBlue" Checked="ChangeThemeToBlue_Checked" IsChecked="True" GroupName="theme" Content="   Blue"></RadioButton>
                            <RadioButton x:Name="rbBlack" Checked="ChangeThemeToBlack_Checked" GroupName="theme" Margin="25,0,0,0" Content="   Black"></RadioButton>
                            <RadioButton x:Name="rbSilver" Checked="ChangeThemeToSilver_Checked" GroupName="theme" Margin="25,0,0,0" Content="   Silver"></RadioButton>
                            <CheckBox IsChecked="False" x:Name="changeThemeAll" Margin="50,0,0,0" Content="   Change All Windows"></CheckBox>
                        </DockPanel>
                        <TextBlock HorizontalAlignment="Left" VerticalAlignment="Top" Margin="10,40,0,0" Text="Opacity" />
                        <Slider Value="{Binding ElementName=mainwin, Path=BorderOpacity, Mode=TwoWay}" SmallChange=".01" Minimum="0.0" Maximum="1.0" 
                                Width="200" HorizontalAlignment="Left" VerticalAlignment="Top" Margin="75,40,0,0" />
                        <TextBlock HorizontalAlignment="Left" VerticalAlignment="Top" Margin="285,40,0,0" Text="{Binding ElementName=mainwin, Path=BorderOpacity}" />
                    </Grid>
                </GroupBox>
            </Grid>
        </Border>
        
    </Grid>
</vt:WpfWindow>
